﻿@model RoadFlow.Model.SystemButton
<form method="post">
    @Html.AntiForgeryToken()
    <br />
    <input type="hidden" name="Id" value="@Model.Id" />
    <table cellpadding="0" cellspacing="1" border="0" width="97%" class="formtable">
        <tr>
            <th style="width: 80px;">名称：</th>
            <td><input type="text" name="Name" id="Name" class="mytext" value="@Model.Name" validate="empty" style="width: 75%" /></td>
        </tr>
        <tr>
            <th>执行脚本：</th>
            <td><textarea class="mytext" name="Events" id="Events" cols="1" rows="1" validate="empty" style="width: 75%; height: 80px;">@Model.Events</textarea></td>
        </tr>
        <tr>
            <th style="width: 80px;">图标：</th>
            <td><input type="text" name="Ico" id="Ico" class="myico" value="@Model.Ico" style="width: 69%" /></td>
        </tr>
        <tr>
            <th>备注说明：</th>
            <td><textarea class="mytext" name="Note" cols="1" rows="1" style="width: 95%; height: 50px;">@Model.Note</textarea></td>
        </tr>
        <tr>
            <th style="width: 80px;">排序：</th>
            <td><input type="text" name="Sort" id="Sort" class="mytext" value="@Model.Sort" validate="empty" /></td>
        </tr>
    </table>
    <div class="buttondiv">
        <input type="button" value="确定保存" class="mybutton" onclick="save(this);" />
        <input type="button" class="mybutton" value="取消关闭" style="margin-left: 5px;" onclick="new RoadUI.Window().close();" />
    </div>
</form>
<script type="text/javascript">
    function save(but)
    {
        var f = document.forms[0];
        if (new RoadUI.Validate().validateForm(f))
        {
            var o = RoadUI.Core.serializeForm($(f));
            $.ajax({
                url: "Save@(Html.Raw(ViewData["queryString"]))", data: o, type: "post", success: function (text)
                {
                    if (RoadUI.Core.checkLogin(text, false))
                    {
                        alert(text);
                    }
                    var win = new RoadUI.Window();
                    $(but).prop("disabled", false);
                    win.reloadOpener();
                    win.close();
                }
            });
        }
    }
</script>